package com.hippo.core.vm

import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.hippo.core.model.Device
import com.hippo.core.state.ScanDeviceState
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class ScanDeviceVM : ViewModel() {

    var uiState by mutableStateOf(ScanDeviceState())


    fun updateState(state: ScanDeviceState) {
        uiState = state
    }


    fun refresh(){
        viewModelScope.launch {
            delay(1000)
            uiState = uiState.copy(isRefresh = false, deviceList = listOf(
                Device(
                    "1",
                    "Mulin",
                    "Mulin",
                    "online",
                )
            ))
        }
    }





}